package com.huanwei.cc.activity;

import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.huanwei.cc.R;
import com.huanwei.cc.base.BaseActivity;
import com.huanwei.cc.bean.FeedbbackBean;
import com.huanwei.cc.db.Z_FanKui_Dao;
import com.huanwei.cc.utils.JSONUtils;
import com.huanwei.cc.utils.Okhttp;
import com.huanwei.cc.utils.SpfUtils;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * 我的反馈
 */
public class Me_feedback_activity extends BaseActivity implements View.OnClickListener {
    private ImageView me_feedback_path;
    private TextView me_feedback_butten;
    private EditText me_feedback;
    private String mS;
    Z_FanKui_Dao z_fanKui_dao;

    @Override
    public int setLayoutId() {
        return R.layout.me_feedback;
    }

    @Override
    public void initViewsAndEvents() {
        findid();

    }

    private void findid() {
        z_fanKui_dao = new Z_FanKui_Dao(Me_feedback_activity.this);
        me_feedback_path = (ImageView) findViewById(R.id.me_feedback_path);
        me_feedback_path.setOnClickListener(this);
        me_feedback_butten = (TextView) findViewById(R.id.me_feedback_butten);
        me_feedback_butten.setOnClickListener(this);
        me_feedback = (EditText) findViewById(R.id.me_feedback);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.me_feedback_path:
                finish();
                break;
            case R.id.me_feedback_butten:
                mS = me_feedback.getText().toString();
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
                System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
                String name = (String) SpfUtils.get(this, "name", "");
                z_fanKui_dao.addMSG("反馈", mS, df.format(new Date()), name);
                Toast.makeText(this, "反馈成功", Toast.LENGTH_SHORT).show();
                finish();
                break;

        }

    }

}
